package cn.xiaobai.domain;

import android.widget.Button;
import android.widget.EditText;

import cn.xiaobai.consts.Trigger;

/**
 * 事件管理
 *
 * @Author yangdaji
 * @Date 2023/12/23
 * @PackageName cn.xiaobai.domain
 * @ClassName Event
 */
public class Event {


    /**
     * 登录按钮
     */
    private Button loginBt;
    /**
     * 注册按钮
     */
    private Button regisBt;

    /**
     * 用户名
     */
    private EditText username;
    /**
     * 密码
     */
    private EditText password;

    public Event(Button loginBt, Button regisBt, EditText username, EditText password) {
        this.loginBt = loginBt;
        this.regisBt = regisBt;
        this.username = username;
        this.password = password;
    }

    public Trigger getTriggerBt(Integer id) {
        if (id.equals(loginBt.getId())) {
            return Trigger.LOGIN;
        } else if (id.equals(regisBt.getId())) {
            return Trigger.REGIS;
        }

        return null;
    }


    public Button getLoginBt() {
        return loginBt;
    }

    public void setLoginBt(Button loginBt) {
        this.loginBt = loginBt;
    }

    public Button getRegisBt() {
        return regisBt;
    }

    public void setRegisBt(Button regisBt) {
        this.regisBt = regisBt;
    }

    public EditText getUsername() {
        return username;
    }

    public void setUsername(EditText username) {
        this.username = username;
    }

    public EditText getPassword() {
        return password;
    }

    public void setPassword(EditText password) {
        this.password = password;
    }
}
